<?php  namespace Home\Controller;

use Hdphp\Controller\Controller;

class OrderController extends Controller{
	
	
	public function index(){
		if($_SESSION['account']){
			$goodsData = Cart::getGoods();
			View::with('data',$goodsData);
			$totalPrice = Cart::getTotalPrice();
			View::with('totalPrice',$totalPrice);
			$shippingaddModel = new \Common\Model\Shippingaddress;
			$shippingaddData = $shippingaddModel->get();
			View::with('saData',$shippingaddData);
			View::make();
			
		}else{
			go(U('Login/index'));
		}

	}
	
	public function addAddress(){
		$shippingaddModel = new \Common\Model\Shippingaddress;
		$shippingaddModel->addData();
		$this->ajax(Q('post.'));
		
	}
	
	public function delAddress(){
		$said = Q('post.said',0,'intval');
		$shippingaddModel = new \Common\Model\Shippingaddress;
		$shippingaddModel->where("said={$said}")->delete();
	}
} 


 ?>